package Lexical;

import Syntax.Production;
import Syntax.Symbol;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

public class test {

    public static void main( String[] args )
    {
      /*  Set<String> a = new HashSet<>();
        a.add("a");
        a.add("b");
        a.add("c");
        Set<String> b = new HashSet<>();
        b.add("a");
        b.add("b");
        b.add("c");
        Set<Set<String>> c = new HashSet<Set<String>>();
        c.add(a);
        c.add(b);
        for(Set<String> e: c)
        {
            for(String s: e)
            {
                System.out.println(s);
            }
        }*/

        /*ArrayList<String> testList = new ArrayList<String>();
        testList.add("a");
        testList.add("a");
        testList.add("b");
        testList.add("c");
        testList.add("d");
        testList.add("a");
        System.out.println( testList.indexOf("a"));
        System.out.println( testList.lastIndexOf("a"));
        System.out.println( testList.size() );*/

        /*Set<Symbol> set1 = new HashSet<Symbol>();
        Set<Symbol> set2 = new HashSet<Symbol>();
        Symbol a1 = new Symbol();
        a1.setType("NonTerminal");
        a1.setContent("L");
        Symbol a2 = new Symbol();
        a2.setType("NonTerminal");
        a2.setContent("L");
        Symbol a3 = new Symbol();
        a3.setType("NonTerminal");
        a3.setContent("A");

        set1.add(a1);
        set1.add(a3);
        set2.add(a2);
        set2.add(a3);
        if( set1.equals(set2) )//并不能依靠 equals判断两个set是否相同
            System.out.println("nice");
        else
            System.out.println("bad");*/


        Symbol sym = new Symbol();
        sym.setType("NonTerminal");
        sym.setContent("A");

        Symbol a = new Symbol();  //对象的引用 即使指针 当引用指向同一个对象时  对象内容改变 对于两个 引用访问的结果都会改变 A a = new A();  A b = a ;  b.op a.op 作用于同一个对象
        a = sym;
        a.setContent(sym.getContent());
        sym.setContent("B");
        System.out.println(a.getContent());
    }
}
